package com.order.service;

//import org.springframework.security.core.GrantedAuthority;
//import org.springframework.security.core.authority.AuthorityUtils;
//import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

public class User
//        implements UserDetails
{
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    private String username;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

//    public Collection<? extends GrantedAuthority> getAuthorities() {
//        return AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_ADMIN");
//    }

    /**
     * 用户是不是没过期
     * @return
     */
    public boolean isAccountNonExpired() {
        return true;
    }

    /**
     * 这个账户是不是没被锁定
     * @return
     */
    public boolean isAccountNonLocked() {
        return true;
    }

    /**
     * 密码是不是没过期
     * @return
     */
    public boolean isCredentialsNonExpired() {
        return true;
    }

    /**
     * 账户是不是可用的
     * @return
     */
    public boolean isEnabled() {
        return true;
    }
}
